import request from '@/config/axios'

// 客户公海 VO
export interface CustHighSeasVO {
  id: number
  custId: number
  code: string
  personName: string
  country: string
  sourceCode: string
  starCode: string
  industryCode: string
  releaseTime: Date
  startReleaseTime: Date
  endReleaseTime: Date
}
// 公海客户释放规则 VO（）
export interface ReleaseRulesVO {
  unclosedCustomerDays: number
  closedCustomerDays: number
  maxCustomerHolding: number
}


// 客户公海 API
export const CustHighSeasApi = {
  // 查询客户公海分页
  getCustHighSeasPage: async (params: any) => {
    return await request.get({ url: `/business/cust-high-seas/page`, params })
  },

  // 批量删除客户公海
  batchDeleteCustHighSeas: async (ids: number[]) => {
    console.log('调用了 batchDeleteCustHighSeas，参数为：', ids)
    return await request.delete({ url: `/business/cust-high-seas/delete-batch`, data: ids })
  },

  // 批量领取客户公海
  pickUpCustomers: async (custIds: number[]) => {
    return await request.post({ url: `/business/cust-high-seas/pick-up`, data: custIds })
  },

  // 更新释放公海客户规则
  updateReleaseRules: async (params: any) => {
    const res = await request.post({ url: `/business/release-rules/update-simple`, data: params })
    console.log(res)
    return res.data
  },

  // 获取IndustryCode
  getIndustryCode: async () => {
    return await request.get({ url: `/business/cust-info/getIndustryCode`})
  },

  // 获取SourceCode
  getSourceCode: async () => {
    return await request.get({ url: `/business/cust-info/getSourceCode`})
  },
  
  // 分配公海客户api调用的是修改业务员的api

  //
}

